wordpress truncate text

50

echo wp_trim_words( get_the_content(), 100 ); // post content
echo wp_trim_words( get_the_excerpt(), 100 ); // post excerpt
echo wp_trim_words( get_the_title(), 100 ); // post title
<?php
$my_content = apply_filters( 'the_content', get_the_content() );
$my_content = wp_strip_all_tags($my_content);
echo wp_trim_words( $my_content, 55, $moreLink);
?>

Comments

Submit
0 Comments